import request from '@/utils/request';
import { AxiosPromise } from 'axios';
import { BeltBodyVO, BeltBodyForm, BeltBodyQuery } from '@/api/business/beltBody/types';

/**
 * 查询带身信息列表
 * @param query
 * @returns {*}
 */

export const listBeltBody = (query?: BeltBodyQuery): AxiosPromise<BeltBodyVO[]> => {
  return request({
    url: '/business/beltBody/list',
    method: 'get',
    params: query
  });
};

/**
 * 查询带身信息详细
 * @param id
 */
export const getBeltBody = (id: string | number): AxiosPromise<BeltBodyVO> => {
  return request({
    url: '/business/beltBody/' + id,
    method: 'get'
  });
};

/**
 * 新增带身信息
 * @param data
 */
export const addBeltBody = (data: BeltBodyForm) => {
  return request({
    url: '/business/beltBody',
    method: 'post',
    data: data
  });
};

/**
 * 修改带身信息
 * @param data
 */
export const updateBeltBody = (data: BeltBodyForm) => {
  return request({
    url: '/business/beltBody',
    method: 'put',
    data: data
  });
};

/**
 * 删除带身信息
 * @param id
 */
export const delBeltBody = (id: string | number | Array<string | number>) => {
  return request({
    url: '/business/beltBody/' + id,
    method: 'delete'
  });
};
